exoskeleton.collections.base_collection = Backbone.Collection.extend({

  __fetchStatus: new exoskeleton.models.load_status,

  fetchStatus: function(){
    return this.__fetchStatus
  },

  parse: function(response){
    return response.data
  },

  fetch: function(options){
    var _this = this ;
    this.__fetchStatus = new exoskeleton.models.load_status()
    Backbone.Collection.prototype.fetch.call(this,{
      success: function(collection, response){
        if(response.success == undefined){
          _this.trigger('fetch:unsuccessful', collection, null, null)
          alert("Response did not come back in appropriate json format needed: {success: [true/false], data: [Your Data], message: [Custom Message]")
          return
        }
        _this.__fetchStatus.set_completed()
        _this.__fetchStatus.set_message(response.message)
        if(response.success){
          _this.__fetchStatus.set_successful()
          _this.trigger('fetch:successful', collection, response.data, response.message)
        } else {
          _this.trigger('fetch:unsuccessful', collection, response.data, response.message)
        }
        if(options && options.success){
          options.success(collection, response)
        }
        _this.trigger('fetch:complete', collection, response.data, response.message)
      },
      error: function(collection, response) {
        _this.__fetchStatus.set_completed()
        _this.__fetchStatus.set_message(response.message)
        _this.__fetchStatus.set_system_error()
        _this.trigger('fetch:error', collection, response.data, response.message)
        if(options && options.error){
          options.error(collection, response)
        }
        _this.trigger('fetch:complete', collection, response.data, response.message)
      }
    })
  }

})